def has_lucky_number(nums):
    """Return whether the given list of numbers is lucky. A lucky list contains
    at least one number divisible by 7.
    """
    for num in nums:
        if num % 7 == 0:
            return True
    return False


def elementwise_greater_than(L, thresh):
    """Return a list with the same length as L, where the value at index i is
    True if L[i] is greater than thresh, and False otherwise.

    >>> elementwise_greater_than([1, 2, 3, 4], 2)
    [False, False, True, True]
    """
    return [ele > thresh for ele in L]


def menu_is_boring(meals):
    """Given a list of meals served over some period of time, return True if the
    same meal has ever been served two days in a row, and False otherwise.
    """
    length = len(meals)
    res = []
    for i in range(length - 1):
        res.append(meals[i] == meals[i + 1])
    res.append(False)
    return res
    # return [meals[i] == meals[i + 1] for i in range(length - 1)]

print(menu_is_boring(["a","a"]))
print(menu_is_boring(["a","b","c"]))


def estimate_average_slot_payout(n_runs):
    """Run the slot machine n_runs times and return the average net profit per run.
    Example calls (note that return value is nondeterministic!):
    >>> estimate_average_slot_payout(1)
    -1
    >>> estimate_average_slot_payout(1)
    0.5
    """
    sum_in = 0
    count = 0
    while n_runs > count:
        sum_in += 1
        sum_in -= play_slot_machine()
        count += 1

    return sum_in/count

def play_slot_machine():
    return 1

def estimate_average_slot_payout1(n_runs):
    # Play slot machine n_runs times, calculate payout of each
    payouts = [play_slot_machine()-1 for i in range(n_runs)]
    # Calculate the average value
    avg_payout = sum(payouts) / n_runs
    return avg_payout